﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

	<Style TargetType="{x:Type Expander}" x:Key="SlidedButton">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Expander}">
		          <Border BorderBrush="White"
		            	  BorderThickness="1"
						  Background="Transparent">
		          	<Grid>
		          		<Grid.RowDefinitions>
		          			 <RowDefinition Height="*"/>  		
						</Grid.RowDefinitions>
						
		          		<ContentPresenter VerticalAlignment="Center"
										  HorizontalAlignment="Center"
										  RecognizesAccessKey="True" />  
										  
						<ContentPresenter Margin="4,4,4,0" Grid.Row="1"
										  ContentSource="Header"
										  x:Name="Header"
										  VerticalAlignment="Bottom"
										  Opacity="0"/>  
										  
						<Border x:Name="Border"
								Background="White"
								Opacity="0" />   	
					</Grid>
	          	  </Border>
				  
				  <ControlTemplate.Triggers>
					
					<EventTrigger SourceName="Border" RoutedEvent="Border.MouseEnter">
						<BeginStoryboard>
							<Storyboard>
								<DoubleAnimation Storyboard.TargetName="Header"
												 Storyboard.TargetProperty="Opacity"
												 From="0"
												 To="1"
												 Duration="0:0:0.3"/>
												 
								<DoubleAnimation Storyboard.TargetName="Border"
												 Storyboard.TargetProperty="Opacity"
												 From="0"
												 To="0.1"
												 Duration="0:0:0.3" />
								
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger>
					
					<EventTrigger SourceName="Border" RoutedEvent="Border.MouseLeave">
						<BeginStoryboard>
							<Storyboard>
								<DoubleAnimation Storyboard.TargetName="Header"
												 Storyboard.TargetProperty="Opacity"
												 From="1"
												 To="0"
												 Duration="0:0:0.3"/>
												 
								<DoubleAnimation Storyboard.TargetName="Border"
												 Storyboard.TargetProperty="Opacity"
												 To="0"
												 Duration="0:0:0.3" />
							</Storyboard>
						</BeginStoryboard>
					</EventTrigger>
					
				  </ControlTemplate.Triggers>
				  
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>